package thread;

import java.security.PublicKey;

public class DaemoThreadDemo {
    public static void main(String[] args) {
        Thread rose = new Thread() {
            public void  run(){
                for (int i=0;i<5;i++){
                    System.out.println("欧,杰克");
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
                System.out.println("rose:啊啊啊啊AAAAAAAAaaaaa");
                System.out.println("pia ji");
            }

        };
        Thread jack =new Thread(){
            public void run(){
                System.out.println("露斯,你挑我也跳");
                try {
                    Thread.sleep(1000);
                }catch (InterruptedException e){
                    e.printStackTrace();
                }

            }
        };
        rose.start();
        //设置守护线程的工作必须在线程启动前进行
        jack.setDaemon(true);
        jack.start();

       //` while (true);
    }
}
